home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Dev / AmigaTalk / examples / penshow.st < prev    next >
Encoding:
Text File  |  1998-09-30  |  990 b   |  50 lines

  1. "
  2.    this is useful only if the plot(3) routines work
  3. "
  4. Class Main
  5. | bic show |
  6. [
  7.    init
  8.       bic <- Pen new.
  9.       show <- PenShow new.
  10.       show withPen: bic.
  11.       bic extent: 0 @ 0 to: 500 @ 500.
  12. |
  13.    main
  14.       self init.
  15.       self polyShow.
  16.       self spiralShow.
  17.       self formShow.
  18. |
  19.    polyShow
  20.       bic erase.
  21.       bic up.
  22.       bic goTo: 50 @ 50.
  23.       bic down.
  24.       (3 to: 8) do: [:i |
  25.          show poly: i length: 10 ].
  26. |
  27.    spiralShow
  28.       bic erase.
  29.       bic up.
  30.       bic goTo: 250 @ 250.
  31.       bic down.
  32.       show spiral: 150 angle: 89
  33. |
  34.    formShow   | newForm saveBic |
  35.       newForm <- Form new.
  36.       saveBic <- bic.
  37.       bic <- PenSave new.
  38.       bic setForm: newForm.
  39.       bic direction: 0.0.
  40.       bic down.
  41.       show withPen: bic.
  42.       self polyShow.
  43.       bic <- saveBic.
  44.       bic down.
  45.       newForm with: bic displayAt: -15 @ ( -15 ).
  46.       newForm with: bic displayAt: 0 @ 0.
  47.       newForm with: bic displayAt: 20 @ ( -20 ).
  48.       ^ newForm
  49. ]
  50.